POV-Ray : Newsgroups : povray.general : Look_at_macro : Re: Look_at_macro Server Time
30 Jul 2024 22:20:48 EDT (-0400)
  Re: Look_at_macro  
From: H  Karsten
Date: 12 Mar 2008 06:15:01
Message: <web.47d7b9c5d9327eeb10a45770@news.povray.org>
Here a little script, that should go, but it doesn't.
It only works, if you use only one of the coordinates...

the Box "looks" toe the ball:

/*
Initial_Frame=0
Final_Frame=360
Initial_Clock=0
Final_Clock=360
*/

camera {
  location  <-1, 1, -2.0>*4
  look_at   0
  rotate <clock/10,clock,0>
}

light_source {<-3,3,-3>*10 color rgb 1}

plane {y, -1 pigment { color rgb 0.5 }}

#declare xp=2*sin(clock/6);
#declare yp=3;
#declare zp=4*sin(clock/10);


sphere {
  <xp,yp,zp>, .5
  texture {pigment {color rgb 0.7}}
}


#declare zf=((zp>0)-0.5)*2;
#declare xw=zf*degrees(acos(yp/(sqrt(pow(zp,2)+pow(yp,2)))));
#declare xf=((xp>0)-0.5)*2;
#declare yw=xf*degrees(acos(zp/(sqrt(pow(xp,2)+pow(zp,2)))))-90;
#declare yf=-((yp>0)-0.5)*2;
#declare zw=yf*degrees(asin(xp/(sqrt(pow(xp,2)+pow(yp,2)))))+90;

box {
  <-2,-1,-0.5>,-<-2,-1,-0.5>
pigment{color rgb <1,0,0>}
scale 0.5
//rotate <xw,yw,zw>
rotate <xw,0,0> // If you use
rotate <0,yw,0> // one of these
rotate <0,0,zw> // alone, it goes!
}
cylinder {0*x,3*x,0.2 pigment{color rgb 1}}
cylinder {0*y,3*y,0.2 pigment{color rgb 1}}
cylinder {0*z,3*z,0.2 pigment{color rgb 1}}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.